package com.javase.objectclone;

/**
 * @Auther: liyanhao
 * @Description: 对象复制
 * @Date: 2022/5/18 13:06
 * @Version: v1.0
 */
public class CloneObject implements Cloneable {
    Object2 object2 = new Object2();
    public Object clone() {
        try {
            return (CloneObject) super.clone();
        } catch (Exception e) {
            return null;
        }
    }
}

class Object2{
    int i = 1;
}